<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>绝对定位</title>
</head>
<style>
    .grandfather {
        position: relative;
        width: 800px;
        height: 800px;
        background-color: orange;
        padding: 50px;
    }
    .father {
        width: 500px;
        height: 500px;
        background-color: skyblue;
    }
    .son {
        position: absolute;
        top: 10px;
        right: 10px;
        width: 200px;
        height: 200px;
        background-color: red;
    }
</style>
<body>
<div class="grandfather">
    <div class="father">
        <div class="son"></div>
    </div>
</div>


</body>
</html>